package org.mpd.amobilempd.network;

import java.util.ArrayList;
import java.util.List;

public class MPDArtist {
	private String name;
	
	public MPDArtist(String name) {
		this.name = name;
		albums = new ArrayList<MPDAlbum>();
	}
	
	private List<MPDAlbum> albums;	
	
	
	public String getName() { return name; }
//	public List<MPDAlbum> getAlbums() { return albums; }
	
	public int getAlbumCount() { return albums.size(); }
	
	public MPDAlbum getAlbumAt(int position) throws IndexOutOfBoundsException
	{
		if(position<albums.size()) {
			return albums.get(position);
		}
		else {
			throw new IndexOutOfBoundsException();
		}
	}
	
	public void addAlbum(MPDAlbum album)
	{
		if(album!=null) {
			albums.add(album);
		}
	}

}
